package com.syauto.sm;

import android.app.Activity;
import android.app.AlertDialog;
import android.content.Context;
import android.os.Bundle;
import android.widget.Button;
import android.widget.TextView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;

import com.syauto.view.BaseLayout;

public abstract class BaseActivity extends Activity 
implements OnClickListener {
	
	

	Button butA;
	Button butB;
	protected BaseLayout ly;

	
	protected abstract void handleTitleBarEvent(int paramInt);
	
	public void onClick(View paramView) {
		handleTitleBarEvent(1);
	}
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
	}

	protected void setView(int paramInt) {
		BaseLayout localBaseLayout = new BaseLayout(this, paramInt);
		this.ly = localBaseLayout;
		BaseLayout localBaseLayoutTwo = this.ly;
		setContentView(localBaseLayoutTwo);
	}
	
	protected void setAppTitle(String title)
	{
		//this.getApplication().
	}
	
	protected AlertDialog AlertDialogShow(Context thisContext, String message)
	{
		LayoutInflater inflater = (LayoutInflater)thisContext.getSystemService(LAYOUT_INFLATER_SERVICE);
		View view = inflater.inflate(R.layout.custom_dialog, null);
		AlertDialog.Builder builder = new AlertDialog.Builder(thisContext);
		TextView lblText = (TextView)view.findViewById(R.id.lblMessage);
		lblText.setText(message);
		builder.setView(view);
		//ProgressDialog myDialog = ProgressDialog.show(thisContext, "", message,true);
		return builder.create();
	}
}
